package com.sdtv.basemodule.http.interceptors;

import java.io.IOException;

import okhttp3.Headers;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * @ProjectName: MediunFusion
 * @Package: com.sdtv.basemodule.http.interceptors
 * @ClassName: HeaderInteceptor
 * @Description: 设置请求头--
 * @Author: 小郭同学
 * @CreateDate: 2019-06-20 15:16
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public abstract class HeaderInteceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request()
                .newBuilder()
                .headers(buildHeaders(chain))
                .build();
        return chain.proceed(request);
    }


    public abstract Headers buildHeaders(Chain chain);
}
